Skip to content

[Doc] database auto-update and database metrics#187

Merged
kaisecheng merged 4 commits intologstash-plugins:masterfrom
kaisecheng:doc_geoip_7_14
Jun 23, 2021
Merged

[Doc] database auto-update and database metrics#187
kaisecheng merged 4 commits intologstash-plugins:masterfrom
kaisecheng:doc_geoip_7_14

Conversation

@kaisecheng
Copy link
Copy Markdown
Contributor

This PR adds more details on how database update behaves and explains how to use database metrics

Comment thread docs/index.asciidoc Outdated

==== Database Metrics

You can monitor database status through https://www.elastic.co/guide/en/logstash/current/node-stats-api.html#node-stats-api[Node Stats API]
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please correct me on how to link the plugin doc to logstash doc

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can monitor database status through https://www.elastic.co/guide/en/logstash/current/node-stats-api.html#node-stats-api[Node Stats API]
You can monitor database status through {logstash-ref}/node-stats-api.html#node-stats-api[Node Stats API]

Comment thread docs/index.asciidoc
Comment on lines +75 to +125
The following request returns a JSON document containing database manager stats,
including:

* the database status and freshness
** `geoip.database.*.status`
*** `init` : initial CC database status
*** `healthy` : using up-to-date EULA database
*** `to_be_expired` : 25 days without calling service
*** `expired` : 30 days without calling service
** `fail_check_in_days` : number of days Logstash fails to call service since the last success
* info about download successes and failures
** `geoip.download.successes` number of successful checks and downloads
** `geoip.download.failures` number of failed check or download
** `geoip.download.status`
*** `checking` : check and download at the moment
*** `succeeded` : last download succeed
*** `failed` : last download failed

[source,js]
--------------------------------------------------
curl -XGET 'localhost:9600/_node/stats/geoip?pretty'
--------------------------------------------------

Example response:

[source,js]
--------------------------------------------------
{
"geoip" : {
"database" : {
"ASN" : {
"status" : "healthy",
"fail_check_in_days" : 0,
"download_at": "2021-06-21T16:06:54+02:00"
},
"City" : {
"status" : "healthy",
"fail_check_in_days" : 0,
"download_at": "2021-06-21T16:06:54+02:00"
}
},
"download" : {
"successes" : 15,
"failures" : 1,
"last_check_at" : "2021-06-21T16:07:03+02:00",
"status" : "succeeded"
}
}
}
--------------------------------------------------

Copy link
Copy Markdown
Contributor Author

@kaisecheng kaisecheng Jun 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would like to know your opinion on whether this part should belong to Node State API or stay in plugin

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

geoip metrics only appear when user uses geoip plugin

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another good example. Thank you. ❤️
Your instincts are right. I believe this info provides the most user benefit here.
If you would like, we can set up a heading/section in the Node Stat API docs to expose this info. Rather than repeating the info, we can point them here. LMKWYT or if you'd like for me to set this up.

Copy link
Copy Markdown
Contributor

@karenzone karenzone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More nice document with good examples, @kaisecheng. Thank you. ❤️
I left some comments in line and offered a suggestion for sharing this info with Node Stats. Let me know how I can help from here.

Comment thread docs/index.asciidoc
The Logstash open source distribution uses the MaxMind Creative Commons license
database by default.

==== Database Auto-update
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
==== Database Auto-update
[id="plugins-{type}s-{plugin}-database_auto"]
==== Database Auto-update

Comment thread docs/index.asciidoc Outdated
Comment on lines +60 to +63
This plugin embedded with Creative Commons (CC) license databases.
When Logstash works in air-gapped enviornment, CC license databases can be used indefinitely.
Logstash checks database update every day. It downloads the latest and can replace the old database on-the-fly.
Once it downloads EULA license databases, it will not fallback to CC license databases.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This plugin embedded with Creative Commons (CC) license databases.
When Logstash works in air-gapped enviornment, CC license databases can be used indefinitely.
Logstash checks database update every day. It downloads the latest and can replace the old database on-the-fly.
Once it downloads EULA license databases, it will not fallback to CC license databases.
This plugin bundles Creative Commons (CC) license databases.
In air-gapped environments, Logstash can use CC license databases indefinitely.
Logstash checks for database updates every day. It downloads the latest and can replace the old database while the plugin is running.
After Logstash downloads EULA license databases, it will not fallback to CC license databases.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WRT "on-the-fly." I offered a suggestion, but I'm not sure if it's correct. Ideally, we should explain exactly how this works.

Comment thread docs/index.asciidoc Outdated
the geoip filter will stop enriching events in order to maintain compliance.
Events will be tagged with `_geoip_expired_database` tag to facilitate the handling of this situation.

NOTE: We recommend you allow Logstash to access internet to download databases
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
NOTE: We recommend you allow Logstash to access internet to download databases
Tip: When possible, allow Logstash to access the internet to download databases so that they are always up-to-date.

Comment thread docs/index.asciidoc

NOTE: We recommend you allow Logstash to access internet to download databases

==== Database Metrics
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
==== Database Metrics
[id="plugins-{type}s-{plugin}-metrics"]
==== Database Metrics

Comment thread docs/index.asciidoc Outdated

==== Database Metrics

You can monitor database status through https://www.elastic.co/guide/en/logstash/current/node-stats-api.html#node-stats-api[Node Stats API]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can monitor database status through https://www.elastic.co/guide/en/logstash/current/node-stats-api.html#node-stats-api[Node Stats API]
You can monitor database status through {logstash-ref}/node-stats-api.html#node-stats-api[Node Stats API]

Comment thread docs/index.asciidoc Outdated
The following request returns a JSON document containing database manager stats,
including:

* the database status and freshness
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* the database status and freshness
* database status and freshness

Comment thread docs/index.asciidoc
Comment on lines +75 to +125
The following request returns a JSON document containing database manager stats,
including:

* the database status and freshness
** `geoip.database.*.status`
*** `init` : initial CC database status
*** `healthy` : using up-to-date EULA database
*** `to_be_expired` : 25 days without calling service
*** `expired` : 30 days without calling service
** `fail_check_in_days` : number of days Logstash fails to call service since the last success
* info about download successes and failures
** `geoip.download.successes` number of successful checks and downloads
** `geoip.download.failures` number of failed check or download
** `geoip.download.status`
*** `checking` : check and download at the moment
*** `succeeded` : last download succeed
*** `failed` : last download failed

[source,js]
--------------------------------------------------
curl -XGET 'localhost:9600/_node/stats/geoip?pretty'
--------------------------------------------------

Example response:

[source,js]
--------------------------------------------------
{
"geoip" : {
"database" : {
"ASN" : {
"status" : "healthy",
"fail_check_in_days" : 0,
"download_at": "2021-06-21T16:06:54+02:00"
},
"City" : {
"status" : "healthy",
"fail_check_in_days" : 0,
"download_at": "2021-06-21T16:06:54+02:00"
}
},
"download" : {
"successes" : 15,
"failures" : 1,
"last_check_at" : "2021-06-21T16:07:03+02:00",
"status" : "succeeded"
}
}
}
--------------------------------------------------

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another good example. Thank you. ❤️
Your instincts are right. I believe this info provides the most user benefit here.
If you would like, we can set up a heading/section in the Node Stat API docs to expose this info. Rather than repeating the info, we can point them here. LMKWYT or if you'd like for me to set this up.

@kaisecheng
Copy link
Copy Markdown
Contributor Author

@karenzone Setting up heading/section in the Node Stat API and pointing them to here sounds the right way. Because it avoids confusion of reading geoip metrics in Node Stat API doc but seeing nothing return when the pipeline doesn't involve geoip plugin.
Yes, it will be great if you can set up this 💪 Thank you

@karenzone
Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Contributor

@karenzone karenzone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor suggestions for your consideration. Otherwise, LGTM 🎉

Comment thread docs/index.asciidoc Outdated
the geoip filter will stop enriching events in order to maintain compliance.
Events will be tagged with `_geoip_expired_database` tag to facilitate the handling of this situation.

Tip: When possible, allow Logstash to access the internet to download databases so that they are always up-to-date.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Tip: When possible, allow Logstash to access the internet to download databases so that they are always up-to-date.
TIP: When possible, allow Logstash to access the internet to download databases so that they are always up-to-date.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All caps required to trigger the special "tip" formatting.

Comment thread docs/index.asciidoc Outdated
[id="plugins-{type}s-{plugin}-metrics"]
==== Database Metrics

You can monitor database status through {logstash-ref}/node-stats-api.html#node-stats-api[Node Stats API]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can monitor database status through {logstash-ref}/node-stats-api.html#node-stats-api[Node Stats API]
You can monitor database status through the {logstash-ref}/node-stats-api.html#node-stats-api[Node Stats API].

@kaisecheng kaisecheng merged commit 3f371f1 into logstash-plugins:master Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants